var uri = '/';

function store(url,title,cid){		
	var arr = url.split('/');
	var id = arr.pop();
	if(arr.pop()=='id'){
		if( isInstall()){
			$.get(uri+'clientgame/store/id/'+id);			
			var ver,state ;
			ver = new ActiveXObject("zxobj.ZXComOjb.1");
			a = ver.AddNumbers(id,getP(2,cid));
			state = ver.RunClt();				
		}else{
			alert('对不起，您没安装游乐星空客户端');
		}
	}
	return false;
}

function download(id,cid){
	if( isInstall()){
		$.get(uri+'clientgame/download/id/'+id);
		var ver,state ;
		ver = new ActiveXObject("zxobj.ZXComOjb.1");
		a = ver.AddNumbers(id,getP(1,cid));
		state = ver.RunClt();
	}else{
		alert('对不起，您没安装游乐星空客户端');
	}
}

function isInstall(){
	var ret = true;
	try{
		var ver;
		ver = new ActiveXObject("zxobj.ZXComOjb.1");
	}catch(e){
		ret = false;
	}
	return ret;
}

/*
构造奇特的参数
type （1下载，2收藏）
cid 分类ID
*/
function getP(type,cid){
	return '' + type + '' + (ishezuo(cid) ? 1 : 0);
}

function ishezuo(cid){
	return cid==20;
}